#include <stdio.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))

#define N_MAX 100000
#define M_MAX N_MAX


int
main(void)
{
	int n, m, n_seq[N_MAX], m_seq[M_MAX];
	register int i = 0, j;
	int last;
	freopen("symmdiff.in", "rt", stdin);
	freopen("symmdiff.out", "w", stdout);

	scanf("%d", &n);
	while (i < n)
		scanf("%d", &n_seq[i++]);
	i = 0;
	scanf("%d", &m);
	while (i < m)
		scanf("%d", &m_seq[i++]);

	i = j = 0;
	last = MIN(n_seq[0], m_seq[0]) - 1;
	while (i < n || j < m) {
		if (n_seq[i] > m_seq[j]) { /* we need m_seq[j] */
			if (j < m) {
				if (last != m_seq[j]) {
					printf("%d ", m_seq[j]);
					last = m_seq[j];
				}
				++j;
			} else if (i < n) {
				if (last != n_seq[i]) {
					printf("%d ", n_seq[i]);
					last = n_seq[i];
				}
				++i;
			}
		} else if (n_seq[i] < m_seq[j]) { /* we need n_seq[i] */
			if (i < n) {
				if (last != n_seq[i]) {
					printf("%d ", n_seq[i]);
					last = n_seq[i];
				}
				++i;
			} else if (j < m) {
				if (last != m_seq[j]) {
					printf("%d ", m_seq[j]);
					last = m_seq[j];
				}
				++j;
			}
		} else /* if (n_seq[i] == m_seq[j] */ {
			last = n_seq[i];
			while (m_seq[j] == last && j < m)
				++j;
			while (n_seq[i] == last && i < n)
				++i;
		}
	}
	putchar('\n');
	return 0;
}
